﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using FreeImageAPI;

namespace Imagenator.Controls
{
	partial class ExrSaveControl : SaveControl
	{
		public ExrSaveControl()
		{
			InitializeComponent();
		}

		protected override void OnLoad(EventArgs e)
		{
			Settings settings = Settings.Load();
			this.cbCompression.Select(settings.ExrCompression);
			this.cbLC.Checked = settings.ExrLumaChroma;
			base.OnLoad(e);
		}

		public override void Close()
		{
			Settings settings = Settings.Load();
			settings.ExrCompression = this.cbCompression.SelectedItem;
			settings.ExrLumaChroma = this.cbLC.Checked;
		}

		protected override FREE_IMAGE_SAVE_FLAGS GetSaveFlags()
		{
			FREE_IMAGE_SAVE_FLAGS flags = base.GetSaveFlags();
			flags |= (FREE_IMAGE_SAVE_FLAGS)this.cbCompression.SelectedItem;
			if (this.cbLC.Checked == true)
				flags |= FREE_IMAGE_SAVE_FLAGS.EXR_LC;
			return flags;
		}
	}
}
